import { createApp } from 'vue'
import Cookies from 'js-cookie'
import ElementPlus from 'element-plus'
import locale from 'element-plus/lib/locale/lang/zh-cn' // 中文语言
import '@/assets/styles/index.scss' // css
import App from './App'
import store from './store'
import router from './router'
import directive from './directive' // directive
// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 注册指令
import plugins from './plugins' // plugins
// import '@/assets/iconAli/iconfont.css'

// svg图标
import 'virtual:svg-icons-register'

import SvgIcon from '@/components/SvgIcon'

import elementIcons from '@/components/SvgIcon/svgicon'

import './permission' // permission control

import webSocket from './utils/webSocket/index'

// 打印预览
import PrintView from '@/components/XiaoheComponents/printView'

// 个人方法
import funComm from '@/utils/funComm.js'

// echarts
import Echarts from './components/XiaoheComponents/echarts'

// datav
import DataVVue3 from '@kjgl77/datav-vue3'

import inall from './components/index'

const app = createApp(App)

app.use(router)
app.use(store)
app.use(plugins)
app.use(elementIcons)
app.use(DataVVue3)
app.use(inall)

app.component('svg-icon', SvgIcon)

directive(app)

// 使用element-plus 并且设置全局的大小
app.use(ElementPlus, {
  locale: locale,
  // 支持 large、default、small
  size: Cookies.get('size') || 'default'
})
app.mount('#app')
